package com.tzbank.wisdom.controller;

import com.tzbank.wisdom.service.LimitService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * 注冊
 * zhangzehuan
 */
@Api(tags = {"限额"})
@RequestMapping("limit")
@RestController
public class LimitController {
    @Autowired
    private LimitService limitService;

    /**
     * 个人网银限额查询
     *
     * @param
     * @param reqBody
     * @return
     */
    @ResponseBody
    @PostMapping(value = "/getLimit")
    @ApiOperation(value = "个人网银限额查询", notes = "个人网银限额查询接口")
    public Map<String, Object> getLimit(@RequestBody Map<String, String> reqBody) {
        return limitService.getLimit(reqBody);
    }

    /**
     * 个人网银限额设置
     *
     * @param [{\"productCode\":\"NT\",\"lmtType\":\"LimitPerTrs\",\"limit\":\"40210\"},
     * {\"productCode\":\"NT\",\"lmtType\":\"LimitPerDay\",\"limit\":\"40000\"},
     * {\"productCode\":\"PF\",\"lmtType\":\"LimitPerTrs\",\"limit\":\"2000\"},
     * {\"productCode\":\"PF\",\"lmtType\":\"LimitPerDay\",\"limit\":\"4562\"},
     * {\"productCode\":\"PAY\",\"lmtType\":\"LimitPerTrs\",\"limit\":\"40980\"},
     * {\"productCode\":\"PAY\",\"lmtType\":\"LimitPerDay\",\"limit\":\"40360\"}]

     * @param reqBody
     * @return
     */
    @ResponseBody
    @PostMapping(value = "/updateLimit")
    @ApiOperation(value = "个人网银限额设置", notes = "个人网银限额设置接口")
    public Map<String, Object> updateLimit(@RequestBody Map<String, String> reqBody) {
        return limitService.updateLimit(reqBody);
    }

}

